package com.zhao.abstractFactory.creater;

import com.zhao.abstractFactory.factory.impl.LandAnimal;
import com.zhao.abstractFactory.factory.impl.SkyAnimal;
import com.zhao.abstractFactory.pojo.Animal;
import lombok.extern.slf4j.Slf4j;

//上帝创造猫和狗
@Slf4j
public class God {
    public void create() {
        Animal cat = new LandAnimal().createAnimal("cat");
        Animal dog = new LandAnimal().createAnimal("dog");

        Animal eagle = new SkyAnimal().createAnimal("eagle");

        eagle.eat("肉");

        cat.sleep();
        dog.eat("米饭");
    }
}
